public class BasicTest {
    public static void main(String[] args) {
        System.out.println("=== 基础验证 ===");
        
        try {
            // 创建基本组件
            UserPreferences prefs = new UserPreferences();
            prefs.setPreferredUnits("metric");
            Location loc = new Location("Beijing");
            
            // 创建API管理器
            MultiAPIManager manager = new MultiAPIManager(prefs);
            
            // 注册服务
            WeatherAPIManager openWeather = new WeatherAPIManager(prefs);
            manager.registerAPIService(openWeather);
            
            System.out.println("✓ 系统初始化完成");
            
            // 检查服务
            if (openWeather.isServiceAvailable()) {
                System.out.println("✓ OpenWeatherMap 可用");
                
                // 获取天气数据
                WeatherData data = manager.getCurrentWeather(loc);
                if (data != null) {
                    System.out.println("✓ 数据获取成功");
                    System.out.println("  温度: " + data.getTemperature() + "°C");
                    System.out.println("  描述: " + data.getDescription());
                    
                    System.out.println("\n🎉 多源数据聚合系统验证成功！");
                } else {
                    System.out.println("✗ 数据获取失败");
                }
            } else {
                System.out.println("✗ OpenWeatherMap 不可用");
            }
            
            manager.shutdown();
            
        } catch (Exception e) {
            System.out.println("✗ 验证失败: " + e.getMessage());
            e.printStackTrace();
        }
    }
} 